package leetcode;

/**
 * @program: datastructureandalogorithm
 * @description:
 * @author: hmx
 * @create: 2021-10-26 15:01
 **/
public class LeetCode117 {

    /*public Node connect(Node root) {
        if (root == null) {
            return null;
        }
        Deque<Node> deque = new LinkedList<>();
        deque.offer(root);
        while (!deque.isEmpty()) {
            //记录当前层元素个数
            int size = deque.size();
            Node prev = null;
            Node temp = null;
            for (int i = 0; i < size; i++) {
                temp = deque.poll();
                if (temp.left != null) {
                    deque.offer(temp.left);
                }
                if (temp.right != null) {
                    deque.offer(temp.right);
                }
                if (prev != null) {
                    prev.next = temp;
                }
                prev = temp;
            }
        }
        return root;


    }*/

}
